home *** CD-ROM | disk | FTP | other *** search
/ MacWarehouse Macintosh Games / MacWarehouse Macintosh Games.iso / AMBER demo / ROXY / ROXY.dxr / 00973_Headgear on.ls < prev    next >
Encoding:
Text File  |  1996-10-18  |  1.2 KB  |  35 lines

  1. on mouseDown
  2.   global oStoryteller, oPuppeteer, gFreezeInventory, gOriginPoint
  3.   set currentLoc to getState(oStoryteller, #currentLocation)
  4.   set portalLocations to [#GgazPath_A_up, #Ggaz_B_W_up, #Ggaz_C_S_up, #Ggaz_D_E_up, #Ggaz_E_N_up, #Gbhs_B_E, #MargEntry, #MargPortal_Ewall]
  5.   if getPos(portalLocations, currentLoc) = 0 then
  6.     set hasPortalLoop to 0
  7.   else
  8.     set hasPortalLoop to 1
  9.   end if
  10.   if (getState(oStoryteller, #itemInUse) = #none) and not gFreezeInventory then
  11.     endLoop(#amberHum)
  12.     set the volume of sound 5 to 0
  13.     if getState(oStoryteller, #endGame) = 1 then
  14.       setState(oStoryteller, #AMBERVISION, #off)
  15.       set the loc of sprite 39 to point(-1000, -1000) + gOriginPoint
  16.       puppetSprite(39, 0)
  17.       if hasPortalLoop = 1 then
  18.         killVideo()
  19.       end if
  20.       updateDisplay(oPuppeteer)
  21.       useInventory(#Headgear)
  22.     else
  23.       setState(oStoryteller, #AMBERVISION, #off)
  24.       wait(5)
  25.       set the castNum of sprite 39 to getProp(the lsForegroundData of oPuppeteer, #HeadgearOff)
  26.       if hasPortalLoop = 1 then
  27.         killVideo()
  28.       end if
  29.       updateDisplay(oPuppeteer)
  30.       wait(5)
  31.       addInventory(#Headgear)
  32.     end if
  33.   end if
  34. end
  35.